package com.ruoyi.configManage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.configManage.mapper.OssConfigMapper;
import com.ruoyi.configManage.domain.OssConfig;
import com.ruoyi.configManage.service.IOssConfigService;

/**
 * 上传配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-12
 */
@Service
public class OssConfigServiceImpl implements IOssConfigService 
{
    @Autowired
    private OssConfigMapper ossConfigMapper;

    /**
     * 查询上传配置
     * 
     * @param id 上传配置主键
     * @return 上传配置
     */
    @Override
    public OssConfig selectOssConfigById(Integer id)
    {
        return ossConfigMapper.selectOssConfigById(id);
    }

    /**
     * 查询上传配置列表
     * 
     * @param ossConfig 上传配置
     * @return 上传配置
     */
    @Override
    public List<OssConfig> selectOssConfigList(OssConfig ossConfig)
    {
        return ossConfigMapper.selectOssConfigList(ossConfig);
    }

    /**
     * 新增上传配置
     * 
     * @param ossConfig 上传配置
     * @return 结果
     */
    @Override
    public int insertOssConfig(OssConfig ossConfig)
    {
        ossConfig.setCreateTime(DateUtils.getNowDate());
        return ossConfigMapper.insertOssConfig(ossConfig);
    }

    /**
     * 修改上传配置
     * 
     * @param ossConfig 上传配置
     * @return 结果
     */
    @Override
    public int updateOssConfig(OssConfig ossConfig)
    {
        ossConfig.setUpdateTime(DateUtils.getNowDate());
        return ossConfigMapper.updateOssConfig(ossConfig);
    }

    /**
     * 批量删除上传配置
     * 
     * @param ids 需要删除的上传配置主键
     * @return 结果
     */
    @Override
    public int deleteOssConfigByIds(Integer[] ids)
    {
        return ossConfigMapper.deleteOssConfigByIds(ids);
    }

    /**
     * 删除上传配置信息
     * 
     * @param id 上传配置主键
     * @return 结果
     */
    @Override
    public int deleteOssConfigById(Integer id)
    {
        return ossConfigMapper.deleteOssConfigById(id);
    }
}
